<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Image Manager</title>
</head>
<body>
<h1>Image Manager</h1>
<ul>

<?php 

$uploadDir = 'images/upload/';

if(isset($_POST['submit']))
{
$uploadfile = $uploadDir . basename($_FILES['myfile']['name']);
move_uploaded_file($_FILES['myfile']['tmp_name'], $uploadfile);
}
?>

<?php
if ($handle = opendir($uploadDir)) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {?>
            <li><a href="<?php echo $uploadDir.$file;?>"><?php echo $file;?></a></li>
        <?php }
    }
    closedir($handle);
}
?> 
</ul>

<br>
<form action="" method="post" enctype="multipart/form-data">
Upload your files:<br>
<input type="file" name="myfile">
<input type="submit" value="Upload" name="submit">
</form>

</body>
</html>